package com.lxy.controller;

import com.lxy.model.User;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/user")
@RestController
public class UserController {

    @GetMapping("/list")
    public String list(String name){
        System.out.println("list user");
        System.out.println(name);
        return "user-list";
    }
    @GetMapping("/del")
    public String del(String name){
        System.out.println("del user");
        System.out.println(name);
        return "user-del";
    }

    @PostMapping("/add")
    public String add(@RequestBody User user){
        System.out.println("add user");
        System.out.println(user);
        return "user-add";
    }
    @PostMapping("/adds")
    public String adds(@RequestBody User user,@RequestBody User user2){
        System.out.println("add user");
        System.out.println(user);
        System.out.println(user2);
        return "user-add";
    }
}


